#include <vld.h>
#include <SFML\Window.hpp>
#include <SFML\Graphics.hpp>
#include "CGame.h"

int main(void)
{
	sf::RenderWindow window(sf::VideoMode(800, 600), "Dice Game Window");

	// Init sutff here
	CGame* pGame = new CGame();

	// Check to see if everything loaded correctly
	if(!pGame->Init(window))
	{
		return EXIT_FAILURE;
	}

	sf::Clock clock;
	clock.restart();
	// Game loop
	while(pGame->isWindowOpen())
	{
		// Input Update Render
		if(!pGame->Input())
		{
			pGame->CloseWindow();
		}

		pGame->Update(clock.getElapsedTime());
		pGame->Render();
		clock.restart();
	}

	// Shut down stuff here
	pGame->Shutdown();
	delete pGame;
	pGame = NULL;

	window;

	return EXIT_SUCCESS;
}